package org.jground.rx.def.apps.core;
import org.jground.rx.*;
import org.jground.rx.gen.*;
import org.jground.util.*;
import java.util.List;
import org.jground.rx.def.apps.accounting.*;
import org.jground.rx.def.apps.commons.*;
import org.jground.rx.def.apps.knowledge.*;
import org.jground.rx.def.*;
import org.jground.rx.def.apps.crm.*;
import org.jground.rx.def.apps.cip.*;
import org.jground.rx.def.apps.legal.*;
import org.jground.rx.def.apps.ipm.*;
@SuppressWarnings("unused")
public class Address extends GenRoot {

    public static final String moid = "org.jground.rx.def.apps.core.Address";

    private static final String street ="street";
    private static final String zip ="zip";
    private static final String city ="city";
    private static final String state ="state";
    private static final String country ="country";
    private static final String phones ="phones";
    private static final String fax ="fax";
    private static final String emails ="emails";
    private static final String $CREATOR ="$CREATOR";

    public static final class AttName {
        public static final String street ="street";
        public static final String zip ="zip";
        public static final String city ="city";
        public static final String state ="state";
        public static final String country ="country";
        public static final String phones ="phones";
        public static final String fax ="fax";
        public static final String emails ="emails";
        public static final String $CREATOR ="$CREATOR";
    }

    public static Address createNew() { return new Address(RXObjectService.getInstance().create(moid)); }

    public static Address getById(String oid) { 
        IRXObject mod = RXObjectService.getInstance().getById(oid);
        if(mod == null) { return null; }
        return new Address(mod);
    }

    public static Address[] getByIds(String... oids) { 
        List<IRXObject> mods = RXObjectService.getInstance().getByIds(moid, oids);
        Address[] res = new Address[mods.size()];
        int i = 0;
        for(IRXObject mod : mods) {
            res[i] = new Address(mod);
            i++;
        }
        return res;
    }

    public static SearchCriteria newSearchCriteria() {
        return  SearchCriteria.create(moid);
    }

    public static Address[] search(SearchCriteria sc) {
        return  wrap(GenRoot._search(sc));
    }

    public static Address[] wrap(List<? extends IRXObjectSynopsis> mods) { 
        Address[] res = new Address[mods.size()];
        int i = 0;
        for(IRXObjectSynopsis mod : mods) {
            res[i] = new Address(mod);
            i++;
        }
        return res;
    }

    public static Address wrap(IRXObjectSynopsis mod) { 
        return new Address(mod);
    }

    private Address(IRXObjectSynopsis rxObject) {this.rxObject = (IRXObject) rxObject;}

    public static String getStreetLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, street).getLabel();
    }

    public static String getStreetDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, street).getDescription();
    }

    public void setStreet(String string) {
        rxObject.set(street, _to_String(string));
    }

    public String getStreet() {
        return _to_String(rxObject.getCurrentValue(street));
    }

    public static String getZipLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, zip).getLabel();
    }

    public static String getZipDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, zip).getDescription();
    }

    public void setZip(String string) {
        rxObject.set(zip, _to_String(string));
    }

    public String getZip() {
        return _to_String(rxObject.getCurrentValue(zip));
    }

    public static String getCityLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, city).getLabel();
    }

    public static String getCityDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, city).getDescription();
    }

    public void setCity(String string) {
        rxObject.set(city, _to_String(string));
    }

    public String getCity() {
        return _to_String(rxObject.getCurrentValue(city));
    }

    public static String getStateLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, state).getLabel();
    }

    public static String getStateDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, state).getDescription();
    }

    public void setState(String string) {
        rxObject.set(state, _to_String(string));
    }

    public String getState() {
        return _to_String(rxObject.getCurrentValue(state));
    }

    public static String getCountryLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, country).getLabel();
    }

    public static String getCountryDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, country).getDescription();
    }

    public void setCountry(String codeValue) {
        rxObject.set(country, _to_String(codeValue));
    }

    public String getCountry() {
        return _to_String(rxObject.getCurrentValue(country));
    }

    public static String getPhonesLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, phones).getLabel();
    }

    public static String getPhonesDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, phones).getDescription();
    }

    public void addPhones(String... string) {
        rxObject.set(phones, _to_String(string));
    }

    public void setPhones(String[] strings) {
        rxObject.set(phones, _to_String(strings));
    }

    public int getPhonesSize() {
        return StringUtils.rnn(rxObject.getValues(phones)).length;
    }

    public String[] getPhones() {
        return _to_String(rxObject.getValues(phones));
    }

    public String getPhones(int index) {
        return _to_String(rxObject.getValues(phones))[index];
    }

    public static String getFaxLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, fax).getLabel();
    }

    public static String getFaxDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, fax).getDescription();
    }

    public void setFax(String string) {
        rxObject.set(fax, _to_String(string));
    }

    public String getFax() {
        return _to_String(rxObject.getCurrentValue(fax));
    }

    public static String getEmailsLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, emails).getLabel();
    }

    public static String getEmailsDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, emails).getDescription();
    }

    public void addEmails(String... string) {
        rxObject.set(emails, _to_String(string));
    }

    public void setEmails(String[] strings) {
        rxObject.set(emails, _to_String(strings));
    }

    public int getEmailsSize() {
        return StringUtils.rnn(rxObject.getValues(emails)).length;
    }

    public String[] getEmails() {
        return _to_String(rxObject.getValues(emails));
    }

    public String getEmails(int index) {
        return _to_String(rxObject.getValues(emails))[index];
    }

    public static String get$CREATORLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getLabel();
    }

    public static String get$CREATORDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getDescription();
    }

    public void set$CREATOR(String string) {
        rxObject.set($CREATOR, _to_String(string));
    }

    public String get$CREATOR() {
        return _to_String(rxObject.getCurrentValue($CREATOR));
    }

}
